package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.entity.Category;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface CategoryMapper {

    @AutoFill(value = OperationType.INSERT)
    void insert(Category category) ;

    Page<Category> queryByPage(Integer page, Integer pageSize, String name, Integer type);

    @Delete("delete from category where id = #{id}")
    void deleteById(Integer id);

    @AutoFill(value = OperationType.UPDATE)
    void update(Category category);

    List<Category> queryCategoryList(Integer type);
}
